<f:view
		xmlns="http://www.w3.org/1999/xhtml"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:f="http://java.sun.com/jsf/core"
		xmlns:a4j="http://richfaces.org/a4j"
		xmlns:rich="http://richfaces.org/rich"
		xmlns:ui="http://java.sun.com/jsf/facelets"
		xmlns:itdep="http://itdep.bsuir.by/jsf"
		>
	<ui:decorate template="/facelets/template/mainTemplate.xhtml">
		<ui:define name="title">#{departmentBundle.studentGroupList}</ui:define>
		<ui:define name="center">
			<ui:decorate template="/facelets/template/centerTemplate.xhtml">
				<ui:define name="content">
					<h:messages/>
					<ui:decorate template="/facelets/template/scrollableTableTemplate.xhtml">
						<ui:param name="actionBean" value="#{studentGroupBean}"/>
						<ui:param name="idPrefix" value="group"/>
						<ui:define name="editPanelContext">
							<h:panelGrid id="groupPanelGrid" columns="3">
								<h:outputText value="#{dictionaryBundle.entryYear}" styleClass="requiredField"/>
								<rich:calendar value="#{studentGroupBean.record.entryYear}" id="#{idPrefix}EntryYear"
											   required="true" styleClass="sizeCopmonent"/>
								<itdep:errorMessage for="#{idPrefix}EntryYear"/>

								<h:outputText value="#{departmentBundle.faculty}" styleClass="requiredField"/>
								<itdep:entitySelectMenu id="#{idPrefix}Faculty"
														value="#{studentGroupBean.filter.faculty}"
														entityType="faculty"
														format="{i18n.shortName}"
														styleClass="sizeCopmonent" required="true" anyValue="true">
									<a4j:support event="onchange" reRender="groupPanelGrid"/>
								</itdep:entitySelectMenu>
								<itdep:errorMessage for="#{idPrefix}Faculty"/>

								<h:outputText value="#{departmentBundle.speciality}" styleClass="requiredField"/>
								<itdep:entitySelectMenu id="#{idPrefix}Speciality"
														value="#{studentGroupBean.filter.speciality}"
														filter="#{studentGroupBean.filter}"
														entityType="speciality"
														format="{i18n.shortName}"
														disabled="#{empty studentGroupBean.filter.faculty}"
														styleClass="sizeCopmonent" required="true" anyValue="true">
									<a4j:support event="onchange" reRender="groupPanelGrid"
												 ajaxSingle="true"/>
								</itdep:entitySelectMenu>
								<itdep:errorMessage for="#{idPrefix}Speciality"/>

								<h:outputText value="#{departmentBundle.specialization}" styleClass="requiredField"/>
								<itdep:entitySelectMenu id="#{idPrefix}Specialization"
														value="#{studentGroupBean.record.specialization}"
														entityType="specialization"
														format="{i18n.shortName}"
														filter="#{studentGroupBean.filter}"
														disabled="#{empty studentGroupBean.filter.speciality}"
														styleClass="sizeCopmonent" required="true" anyValue="true">
									<a4j:support event="onchange" reRender="groupPanelGrid"
												 ajaxSingle="true"/>
								</itdep:entitySelectMenu>
								<itdep:errorMessage for="#{idPrefix}Specialization"/>

								<h:outputText value="#{departmentBundle.studentGroup}" styleClass="requiredField"/>
								<h:inputText value="#{studentGroupBean.record.translations.description.value}"
											 id="#{idPrefix}Code" required="true" maxlength="100"
											 disabled="#{empty studentGroupBean.record.specialization}"
											 styleClass="sizeCopmonent"/>
								<itdep:errorMessage for="#{idPrefix}Code"/>
							</h:panelGrid>
						</ui:define>


						<ui:define name="tableContext">
							<rich:column>
								<f:facet name="header"><h:outputText value="#{dictionaryBundle.entryYear}"/></f:facet>
								<h:outputText value="#{record.entryYear}">
									<f:convertDateTime pattern="yyyy" timeZone="EET"/>
								</h:outputText>
							</rich:column>
							<rich:column>
								<f:facet name="header"><h:outputText
										value="#{departmentBundle.studentGroup}"/></f:facet>
								<ui:insert name="debug">
									<itdep:entityOutput value="#{record}" format="{i18n.description}"
														locale="#{translationBean.locale}"/>
								</ui:insert>
							</rich:column>
							<rich:column>
								<f:facet name="header"><h:outputText
										value="#{departmentBundle.speciality}"/></f:facet>
								<itdep:entityOutput value="#{record.specialization.speciality}" format="{i18n.fullName}"
													locale="#{translationBean.locale}"/>
							</rich:column>
							<rich:column>
								<f:facet name="header">
									<h:outputText value="#{departmentBundle.specialityCode}"/>
								</f:facet>
								<h:outputText value="#{record.specialization.speciality.specialityCoding}"/>
							</rich:column>
							<rich:column>
								<f:facet name="header"><h:outputText
										value="#{departmentBundle.specializationCode}"/></f:facet>
								<h:outputText value="#{record.specialization.specializationCoding}"/>
							</rich:column>

						</ui:define>
					</ui:decorate>
				</ui:define>
			</ui:decorate>
		</ui:define>
	</ui:decorate>
</f:view>